<?php
// 本类由系统自动生成，仅供测试用途
class IndexAction extends Action {
    public function index(){
        //$m=new Model("User");
        $m=M("User");
       // $arr=$m->select();
        //$id=2;
        //$arr=$m->find($id);
      //  $arr=$m->where("id=2")->getField("username");
       // var_dump($arr);
//           $m->username="张三";
//           $m->sex="1";
//           $m->add();
//           $m->delete("2");
//           $m->where("id=3")->delete();
           $h1["id"]=1;
           $h1["username"]="陈旺旺3";
           $count=$m->save($h1);
//        $this->assign("data",$arr);
        $this->display('User:test');
    }
    public function show(){
       // echo "你访问了show方法";
       //$name="陈旺旺";
        //$this->assign("data",$name);
        $m=M();
       // $data['username']=array("like",array('%cw%',"%陈%"),'and');
//          $data['id']=array("not in",array(4,5,7));
        //  $data['id']=array(array('GT',2),array("LT",8),'OR');
       $result=$m->execute("INSERT INTO tp_user( `username`) VALUES ('cww3')");
        //$arr=$m->where('id=8')->select();
        var_dump($result);
        $this->display();
    }
}